#ifndef _ACTION_COMBINATION_
#define _ACTION_COMBINATION_

#include "utility.h"
#include <wx/panel.h>
#include <wx/dc.h>
#include <wx/timer.h>

class ActionCombination: public wxPanel
{
public:
	ActionCombination(wxWindow* parent,wxWindowID id=wxID_ANY,const wxPoint& pos=wxDefaultPosition,const wxSize& size=wxDefaultSize);
	virtual ~ActionCombination();
	void AddAction(SActionInfo &action);
	void ClearAction();
	void SetActionList(vector<SActionInfo> &actionList)
	{
		m_actionList = actionList;
		if(!m_timer.IsRunning())
			Refresh();
	}
	vector<SActionInfo> &GetActionList()
	{
		return m_actionList;
	}
	void NextFrame()
	{
		m_curFrame++;
	}
	bool Start();
	void Stop();
private:
	void OnPaint(wxPaintEvent& event);
	void OnBackground(wxEraseEvent &event);
	void OnTimer(wxTimerEvent &event);
	void Draw(wxDC &dc);
	void DrawAction(wxDC &dc,SActionInfo &action,bool select);

	void LeftDown(wxMouseEvent &event);
	void RightDown(wxMouseEvent &event);
	void LeftUp(wxMouseEvent &event);
	void MoveSelect(int moveX,int moveY);
	void MouseMove(wxMouseEvent &event);
	void OnKeyDown(wxKeyEvent& event);
	bool m_drag;
	int m_mouseX;
	int m_mouseY;
	wxTimer m_timer;
	vector<SActionInfo> m_actionList;
	size_t m_curFrame;
	size_t m_selAction;

	wxDECLARE_EVENT_TABLE();
};

#endif